import QtQuick 1.1
import com.nokia.symbian 1.1
 
SelectionListItem {
    id: root
 
    property int curDay:    Qt.Monday
    property int curHour:   0
    property int curMinute: 0
 
    title: dlgSelectDayOfWeekAndTime.localizedDayNameByIdx( curDay )
    subTitle: buildTimeString()
 
    onClicked: {
        dlgSelectDayOfWeekAndTime.curDay    = root.curDay
        dlgSelectDayOfWeekAndTime.curHour   = root.curHour
        dlgSelectDayOfWeekAndTime.curMinute = root.curMinute
        dlgSelectDayOfWeekAndTime.launch()
    }
 
    DayOfWeekTimeDialog {
        id: dlgSelectDayOfWeekAndTime
        onAccepted: {
            root.curDay    = dlgSelectDayOfWeekAndTime.curDay
            root.curHour   = dlgSelectDayOfWeekAndTime.curHour
            root.curMinute = dlgSelectDayOfWeekAndTime.curMinute
        }
    }
 
    function buildTimeString()
    {
        var x = curHour < 10 ? "0" + curHour : curHour
        x += ":"
        x += curMinute < 10 ? "0" + curMinute : curMinute
 
        return x
    }
}
